<#assign ctx=springMacroRequestContext.contextPath/>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title></title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <link rel="stylesheet" href="${ctx}/style/font/font.css"/>
    <link rel="stylesheet" href="${ctx}/plugin/layui/css/layui.css"/>
    <link rel="stylesheet" href="${ctx}/plugin/layer/theme/default/layer.css"/>
</head>
<body>
<input id="basePath" type="hidden" value="${ctx}"/>
<form class="layui-form" id="editFtpForm">
    <br>
    <div class="layui-form-item">
        <label class="layui-form-label">FTP协议</label>
        <div class="layui-input-inline" style="margin-right: 30px">
             <#switch ftpInfo.ftpType>
                 <#case "1">
                    <input type="text" class="layui-input" value="ftp协议" readonly>
                     <#break>
                 <#case "2">
                    <input type="text" class="layui-input" value="ftps协议" readonly>
                     <#break>
                 <#case "3">
                    <input type="text" class="layui-input" value="sftp协议" readonly>
                     <#break>
             </#switch>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">FTP名称</label>
        <div class="layui-input-inline" style="margin-right: 30px">
            <input type="text" class="layui-input" value="${ftpInfo.ftpName}" readonly>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">FTP用户</label>
        <div class="layui-input-inline" style="margin-right: 30px">
            <input type="text" class="layui-input" value="${ftpInfo.ftpUser}" readonly>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">FTP密码</label>
        <div class="layui-input-inline" style="margin-right: 30px">
            <input type="text" class="layui-input" value="${ftpInfo.ftpPass}" readonly>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">FTP地址</label>
        <div class="layui-input-inline" style="margin-right: 30px">
            <input type="text" class="layui-input" value="${ftpInfo.ftpHost}" readonly>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">FTP端口</label>
        <div class="layui-input-inline" style="margin-right: 30px">
            <input type="text" class="layui-input" value="${ftpInfo.ftpPort}" readonly>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">FTP模式</label>
        <div class="layui-input-inline" style="margin-right: 30px">
             <#if (ftpInfo.ftpMode)=="1">
                  <input type="text" class="layui-input" value="PORT主动方式" readonly>
             <#else>
                 <input type="text" class="layui-input" value="PASV被动方式" readonly>
             </#if>
        </div>
    </div>
    <div class="layui-form-item" style="text-align:center; width:100%;position:fixed; bottom:0;">
        <input type="button" id="backFtpBtn" value="返回" class="layui-btn layui-btn-sm layui-btn-warn"/>
    </div>
</form>

<script type="text/javascript" src="${ctx}/plugin/jquery/jquery.min-1.9.1.js"></script>
<script type="text/javascript" src="${ctx}/plugin/layui/layui.js"></script>
<script type="text/javascript" src="${ctx}/plugin/layer/layer.js"></script>
<script>
    layui.use('form', function () {
        var form = layui.form;
        //渲染表单
        form.render();
    });

    $(document).ready(function () {
        //注册监听事件
        $("#backFtpBtn").on("click", function () {
            //关闭弹出层
            var index = parent.layer.getFrameIndex(window.name);
            parent.layer.close(index);
        });
    });
</script>
</body>
</html>